using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Collections;
using System.Text;
    
namespace PBR
{
    /// <summary>
    /// Represents a segmented portion of a layer. These segments are derived from
    /// a connected component algorithm run on the inverted edges image provided.
    /// </summary>
    public class Segment
    {
        public class SimplePoint
        {
            public int x;
            public int y;

            public SimplePoint(int x, int y)
            {
                this.x = x;
                this.y = y;
            }
        }

        #region Constants

        #endregion

        #region Member Variables

        // KDTree holding the user input vectors
        public KDTreeDLL.KDTree vectorsKDTree;

        // List holding the user input vectors
        public List<KDNodeData> vectorsList;

        // Rectangle the segment lies in
        public Rectangle rect;

        public Material Material;

        /// <summary>
        /// How many strokes have been placed in this segment
        /// </summary>
        public int StrokesPlaced;

        /// <summary>
        /// How many strokes should go in this region
        /// Determined at image load time
        /// </summary>
        public int StrokesDesired;

        /// <summary>
        /// Array of valid pixels
        /// </summary>
        public ArrayList Pixels;

        #endregion

        #region Member Functions

        /// <summary> 
        /// Default constructor
        /// </summary>
        public Segment(Rectangle rect, Material material)
        {
            this.vectorsKDTree = new KDTreeDLL.KDTree(2);
            this.vectorsList = new List<KDNodeData>();
            this.rect = rect;
            this.Material = material;

            StrokesDesired = 0;
            StrokesPlaced = 0;
            Pixels = new ArrayList();
        }

        #endregion

        #region Properties

        #endregion
    }
}
